# a := $(c)	//即使变量
# b = $(c)	//延时变量
# c = abc	
# d = hello	
# d ?= No		//只有第一次生效，后面不生效
# all:
# 	@echo a = $(a)
# 	@echo b = $(b)
# 	@echo d = $(d)

# #makefile通用函数介绍
# A = a b c
# B = $(foreach f, $(A), $(f),o)	#对目标中每个符合的值执行对应的操作

# C = a b c d/
# D = $(filter %/, $(C)) #从变量C中取出符合格式的值
# E = $(filter-out %/, $(C)) #从变量C中取出所有不符合格式的值
# files = $(wildcard *.c)	#从目标中寻找符合条件的文件
# files2 = a.c b.c c.c d.c abc/
# files3 = $(wildcard $(files2))	#从目标中找到真实存在的文件
# file4 = $(patsubst %c, %.b, $(files2))
# #从目标中取出每一个值，如果符合格式，就进行替换
# # @在makefile中表示隐藏，不可见

# all:
# 	@echo B = $(B)
# 	@echo D = $(D)
# 	@echo E = $(E)
# 	@echo files = $(files)
# 	@echo files3 = $(files3)
# 	@echo file4 = $(file4)

# test : a.o
# 	gcc -o test $^
# a.o : a.c c.h
# %.o : %.c
# 	gcc -c -o $@ $<
	
# .PHONY:clean
# clean:
# 	rm -f test

# a = 5
# #想要执行的命令
# #Tab键 具体的命令
# all:	
# 	echo a = $(a)   、


# a := $(c)	 	#即使变量，也叫简单变量，立马赋值
# b = $(c)		#延时变量，用到再赋值
# c = abc	
# d = hello	
# d ?= No			#延时变量，如果是第一次定义才起效，如果已经定义过了就忽略这个指令
#                 #"+=" 附加，它是延时变量还是即时变量取决于前面的值,不太好演示就不举例了

# all:
# 	@echo a = $(a)
# 	@echo b = $(b)
# 	@echo d = $(d)
# .PHONY:test
# test : a.c
# 	gcc -o test a.c

# .PHONY:clean
# clean:
# 	rm -f test

# all : test test2
# test : test.o 
# 	gcc	-o test	test.o
# test2 : test2.o
# 	gcc -o test2 test2.o

# %.o :  %.c
# 	gcc -o $@ $^
# .PHONY:clean
# clean:
# 	rm -f test
# 	rm -f test2


# a = x.o obj.o
# b = $(patsubst %.o,%.c, $(a))
# c = $(patsubst %.c,%.o,x.c.c bar.c)

# all:
# 	@echo a = $(a)
# 	@echo b = $(b)
# 	@echo c = $(c)

# a = hello vscode
# b = $(findstring hello, $(a))
# c = $(findstring enen, $(a))

# all:
# 	@echo a = $(a)
# 	@echo b = $(b)
# 	@echo c = $(c)

# a = hello.c vscode.o a.c b.s
# b = $(filter %.c, $(a))
# c = $(filter-out %.c, $(a))

# all:
# 	@echo a = $(b)
# 	@echo c = $(c)

# a = hello.c vscode.o a.c b.s
# b = $(sort $(a))
# all:
# 	@echo b = $(b)

# all : test test2	//告诉makefile要生成哪几个程序

# .PHONY:clean
# clean:
# 	rm -f test
# 	rm -f test2

# all : client server

# client : client.o wrap.o
# 	gcc -o $@ $^
# server : server.o wrap.o
# 	gcc -o $@ $^

# client.o : client.c wrap.h 
# 	gcc -o $@ $^
# server.o : server.c wrap.h 
# 	gcc -o $@ $^
# wrap.o : wrap.h 
# 	gcc -o $@ $^
# .PHONY:clean
# clean:
# 	rm -f client server *.o



	